class Hanzi:
    count = 0  # 类属性，用于计数

    def __init__(self, radical: str, component: str):
        self.radical = radical    # 部首
        self.component = component  # 部件
        Hanzi.count += 1  # 每创建一个实例，计数加1

    def compose(self) -> str:
        return self.radical + self.component


# 主程序
if __name__ == "__main__":
    h1 = Hanzi("氵", "青")
    h2 = Hanzi("亻", "言")
    h3 = Hanzi("口", "马")

    print("组合的汉字有：")
    print(h1.compose())
    print(h2.compose())
    print(h3.compose())
    print(f"共组合了{Hanzi.count}个汉字")